<?php declare(strict_types=1);
/**
 * This file is part of Swoft.
 *
 * @link     https://swoft.org
 * @document https://swoft.org/docs
 * @contact  group@swoft.org
 * @license  https://github.com/swoft-cloud/swoft/blob/master/LICENSE
 */

function user_func(): string
{
    return 'hello';
}

/**
 * Hash the given value.
 *
 * @param  string  $value
 * @param  array   $options
 * @return string
 */
function bcrypt($value, $options = [])
{
    $hash = password_hash($value, PASSWORD_BCRYPT, [
        'cost' => $options['rounds'] ?? 10,
    ]);

    if ($hash === false) {
        throw new RuntimeException('Bcrypt hashing not supported.');
    }

    return $hash;
}